UserProfileStats.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Coins, CalendarCheck, Flame } from 'lucide-react';
  2. import { UserProfileDto } from '@/types/account/profile';
  3. type Props = {
  4. profile: UserProfileDto;
  5. };
  6. export default function UserProfileStats({ profile }: Props) {
  7. const showDonation = profile.totalDonatedAmount !== null && profile.totalDonatedAmount !== undefined;
  8. return (
  9. <section className="user-profile__stats" aria-label="회원 활동 통계">
  10. {showDonation && (
  11. <div className="user-profile__stat">
  12. <Coins size={20} className="user-profile__stat-icon user-profile__stat-icon--coins" strokeWidth={1.75} />
  13. <div className="user-profile__stat-body">
  14. <span className="user-profile__stat-label">후원 총액</span>
  15. <span className="user-profile__stat-value">{(profile.totalDonatedAmount ?? 0).toLocaleString()} P</span>
  16. </div>
  17. </div>
  18. )}
  19. <div className="user-profile__stat">
  20. <CalendarCheck size={20} className="user-profile__stat-icon user-profile__stat-icon--attendance" strokeWidth={1.75} />
  21. <div className="user-profile__stat-body">
  22. <span className="user-profile__stat-label">출석 수</span>
  23. <span className="user-profile__stat-value">{profile.attendanceCount.toLocaleString()}일</span>
  24. </div>
  25. </div>
  26. <div className="user-profile__stat">
  27. <Flame size={20} className="user-profile__stat-icon user-profile__stat-icon--streak" strokeWidth={1.75} />
  28. <div className="user-profile__stat-body">
  29. <span className="user-profile__stat-label">개근 일수</span>
  30. <span className="user-profile__stat-value">{profile.consecutiveDays.toLocaleString()}일</span>
  31. </div>
  32. </div>
  33. </section>
  34. );
  35. }